aggRelations is package{
  -- test out some of the aggregate relation stuff
  
  type testType is item{
    pos has type integer;
  } or empty;

  testf has type (relation of testType, integer) => relation of testType;
  testf(Is, P) is relation of { all X where (X matching item{pos=P}) in Is};
	
  main has type action();
  main() do {
    var ns := relation of {1;6;5;3;8;5;7;3;5;4};
	items is relation of {all item{pos=E} where E in ns};
	logMsg(info,"items = $items");
	
	logMsg(info, display(testf(items,3)));
  };
}